import Vue from 'vue'
import VueRouter from 'vue-router'
import AmendDish from '../components/AmendDish'
import AdminPage from '../components/AdminPage'
import adminPage from '../components/adminPage1'
import UseradminPage from '../components/UseradminPage'
import MerchatadminPage from '../components/MerchatadminPage'
import MerchatPage from '../components/user_pb/MerchatPage'
import MainPage from '../components/MainPage'
import MerchatOrders from '../components/MerchatOrders'
// import ElementUI from 'element-ui'
import Businessman from '../components/BusinessmanPage'
import ForumPage from '../components/ForumPage'
import MerchatInfo from '../components/MerchatInfo'
// import AmendDish from '../components/AmendDish'
import Login from '../components/Login'
import Register from '../components/Register'
// import { component } from 'vue/types/umd'
import UserInfo from '../components/UserInfo'
import UserOrders from '../components/UserOrders'
import UserOrderPage from '../components/UserOrderPage'
Vue.use(VueRouter)

// Vue.use(ElementUI)
const routes = [
    {
        path: '/',
        name: 'Home',
        redirect: '/Login'
    },
    {
        path:'/UserOrderPage',
        name:'UserOrderPage',
        component:UserOrderPage,
        children:[
            {
                path:'MainPage',
                name:'MainPage',
                component:MainPage
            },
            {
                path:'ForumPage',
                name:'ForumPage',
                component:ForumPage
            },
            {
                path:'UserInfo',
                name:'UserInfo',
                component:UserInfo
            },
            {
                path:'MerchatPage',
                name:'MerchatPage',
                component:MerchatPage
            },
            {
                path:'UserOrders',
                name:'UserOrders',
                component:UserOrders
            },
        ]
    },
    {
        path:'/ForumPage',
        name:'ForumPage',
        component:ForumPage
    },
    {
        path:'/Businessman',
        component: Businessman,
        children: [
            // {
            //     path:'ForumPage/:merId',
            //     name:'ForumPage',
            //     component:ForumPage
            // },
            {
                path:'MerchatOrders/:merId',
                name:'MerchatOrders',
                component:MerchatOrders
            },
            {
                path:'AmendDish/:merId',
                name:'AmendDish',
                component:AmendDish
            },
            {
                path:'MerchatInfo/:merId',
                name:'MerchatInfo',
                component:MerchatInfo
            },
        ]
    },
    {
        path:'/MerchatOrders',
        component: MerchatOrders
    },
    {
        path: '/MerchatInfo',
        component: MerchatInfo//所对应的组件地址
    },
     {
        path: '/Register',
        name: 'RegisterForm',
        component: Register
    },
    {
        path: '/Login',
        name: 'Login',
        component: Login
    },
    {
        path: '/AdminPage',
        component: AdminPage//所对应的组件地址
    },
    {
        path: '/adminPage1',
        component: adminPage//所对应的组件地址
    },
    {
        path: '/UseradminPage',
        component: UseradminPage//所对应的组件地址
    },
    {
        path: '/MerchatadminPage',
        component: MerchatadminPage//所对应的组件地址
    },
    {
        path: '/MainPage',
        component: MainPage,//所对应的组件地址
    },
    {
        path: '/MerchatPage',
        component: MerchatPage//所对应的组件地址
    },
    //  用户信息
    //  {
    //     path:'/UserInfo',
    //     component:UserInfo,
    // },
    //用户订单列表
    {
        path:'/UserOrders',
        component:UserOrders
    }
]
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router